package com.manage.demo.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.manage.demo.annotation.Verify;
import com.manage.demo.controller.LoginController;
import com.manage.demo.dao.model.UserInfo;
import com.manage.demo.service.UserService;
//import com.example.demo.util.ToolUtil;
//import com.manage.demo.validation.UserParams;

@Controller

public class LoginSuccessController {
    @Autowired
    private UserService userService;
    private static final Logger logger = LogManager.getLogger(LoginController.class);
    
    // 登录成功界面
    @RequestMapping("/log_success")
    public ModelAndView welcome(HttpServletRequest request, HttpServletResponse response) {

        return new ModelAndView("html/log_success.html");
    }
    // 注销
    @GetMapping("/logout")
    public String loginOut(HttpServletRequest request) {
        System.out.println("????");
        request.getSession().invalidate();  // 清除session所有信息
        return "redirect:login/?framework=html";
     
    }
    



}
